package com.example.rabbit.consumer;

import com.example.rabbit.config.PriorityConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @Author ifredomvip@gmail.com
 * @Date 2022/8/15 17:07
 * @Version 1.0.0
 * @Description
 **/
@Slf4j
@Component
public class PriorityConsumer {

    @RabbitListener(queues = PriorityConfig.PRIORITY_QUEUE)
    public void priorityConsumer(Message message) {

        log.info("优先级" + new String(message.getBody()));
    }
}
